package org.lds.scheduled.job.admin.business.worker.controller;


import lombok.RequiredArgsConstructor;
import org.lds.scheduled.job.admin.business.worker.service.WorkerService;
import org.lds.scheduled.job.admin.client.core.model.request.RegisterWorkerRequest;
import org.lds.scheduled.job.common.model.dto.ResultDTO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/remote/worker")
public class WorkerRemoteController {
    private final WorkerService workerService;

    @PostMapping("/register")
    public ResultDTO<Long> registerWorker(@RequestBody RegisterWorkerRequest request) {
        return workerService.registerWorker(request);
    }

}